<?php get_header(); ?>

	<main id="main" class="page-artigos" role="main">
		<!-- section -->
		<section id="content">
			
			<h1><?php the_title(); ?></h1>
			<?php
			$wp_query = new WP_Query(array(
				'post_type'              => 'artigo',
				'pagination'             => true,
				'paged'                  => (get_query_var('paged')) ? get_query_var('paged') : 1,
				'posts_per_page'         => '6',
				'post__not_in' 			 => array($ultimanoticia)
			));
			if ($wp_query->have_posts()){
				while ($wp_query->have_posts()) : $wp_query->the_post();
				
				?>
					<!-- article -->
					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
						<strong class="data"><?php echo get_the_date('d/m/Y'); ?></strong>
						<h2 class="t1"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
						<p><a href="<?php the_permalink(); ?>"><?php echo limitar(strip_tags(get_the_content()), 200); ?></a></p>
					</article>
					<!-- /article -->
				<?php
				endwhile;
				html5wp_pagination($wp_query->max_num_pages);
			}else{
			?>
				<h2>Em construção</h2>
			<?php
			}
			wp_reset_postdata();
			?>
		
		</section>
		<!-- /section -->
		<?php get_sidebar(); ?>
	</main>

<?php get_footer(); ?>
